/**
 * WooCommerce Style Override
 * WooCommerce样式覆盖文件
 * 
 * 确保HTML模板样式正确应用到WordPress/WooCommerce模板
 * 
 * @package WP Bootstrap Woo
 */

/* ==========================================================================
   WooCommerce基础样式重置
   ========================================================================== */

/* 移除WooCommerce默认样式 */
.woocommerce-page .woocommerce-message,
.woocommerce-page .woocommerce-error,
.woocommerce-page .woocommerce-info {
    border: none !important;
    background: none !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 产品网格布局 */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce ul.products li.product {
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 产品图片 */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.woocommerce ul.products li.product img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1;
    border-radius: 12px 12px 0 0;
}

/* 产品信息 */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    padding: 15px 20px 10px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.woocommerce ul.products li.product .price {
    padding: 0 20px 15px;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #007cba;
}

.woocommerce ul.products li.product .price del {
    color: #999;
    font-weight: 400;
    margin-right: 10px;
}

/* 添加到购物车按钮 */
.woocommerce ul.products li.product .add_to_cart_button {
    width: 100%;
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

.woocommerce ul.products li.product .add_to_cart_button:hover {
    background: #005a8b;
    color: #fff;
}

/* ==========================================================================
   单个产品页面样式
   ========================================================================== */

/* 产品画廊 */
.woocommerce div.product div.images {
    margin-bottom: 30px;
}

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
    margin: 0;
    padding: 0;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image {
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* 产品摘要 */
.woocommerce div.product .summary {
    padding-left: 30px;
}

.woocommerce div.product .summary .entry-title {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 15px;
}

.woocommerce div.product .summary .price {
    font-size: 28px;
    font-weight: 700;
    color: #007cba;
    margin-bottom: 20px;
}

.woocommerce div.product .summary .woocommerce-product-details__short-description {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* 产品表单 */
.woocommerce div.product form.cart {
    margin-bottom: 30px;
}

.woocommerce div.product form.cart .quantity {
    display: inline-block;
    margin-right: 15px;
    position: relative;
}

.woocommerce div.product form.cart .quantity .qty {
    width: 80px;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background: #005a8b;
}

/* ==========================================================================
   购物车页面样式
   ========================================================================== */

.woocommerce-cart table.cart {
    border-collapse: collapse;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.woocommerce-cart table.cart th,
.woocommerce-cart table.cart td {
    padding: 20px 15px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.woocommerce-cart table.cart th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woocommerce-cart .cart-collaterals {
    margin-top: 40px;
}

.woocommerce-cart .cart-collaterals .cart_totals {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.woocommerce-cart .cart-collaterals .cart_totals h2 {
    margin-bottom: 20px;
    color: #212529;
    font-weight: 700;
}

.woocommerce-cart .cart-collaterals .cart_totals table {
    width: 100%;
}

.woocommerce-cart .cart-collaterals .cart_totals table th,
.woocommerce-cart .cart-collaterals .cart_totals table td {
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #dee2e6;
}

/* ==========================================================================
   结账页面样式
   ========================================================================== */

.woocommerce-checkout .checkout-form {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

.woocommerce-checkout .checkout-billing,
.woocommerce-checkout .checkout-shipping {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.woocommerce-checkout .checkout-order-review {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    position: sticky;
    top: 20px;
}

.woocommerce-checkout .woocommerce-form-row {
    margin-bottom: 20px;
}

.woocommerce-checkout .woocommerce-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.woocommerce-checkout .woocommerce-form-row input,
.woocommerce-checkout .woocommerce-form-row select,
.woocommerce-checkout .woocommerce-form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.woocommerce-checkout .woocommerce-form-row input:focus,
.woocommerce-checkout .woocommerce-form-row select:focus,
.woocommerce-checkout .woocommerce-form-row textarea:focus {
    outline: none;
    border-color: #007cba;
}

/* ==========================================================================
   我的账户页面样式
   ========================================================================== */

.woocommerce-account .woocommerce-MyAccount-navigation {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin-bottom: 5px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 12px 15px;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #007cba;
    color: #fff;
}

.woocommerce-account .woocommerce-MyAccount-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ==========================================================================
   通知消息样式
   ========================================================================== */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.woocommerce-message {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.woocommerce-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

.woocommerce-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

/* ==========================================================================
   响应式设计
   ========================================================================== */

@media (max-width: 1200px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .woocommerce div.product .summary {
        padding-left: 20px;
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .woocommerce div.product .summary {
        padding-left: 0;
        margin-top: 30px;
    }
    
    .woocommerce div.product .summary .entry-title {
        font-size: 24px;
    }
    
    .woocommerce div.product .summary .price {
        font-size: 22px;
    }
    
    .woocommerce-checkout .checkout-form {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .woocommerce-checkout .checkout-order-review {
        position: static;
    }
    
    .woocommerce-cart table.cart th,
    .woocommerce-cart table.cart td {
        padding: 15px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .woocommerce-checkout .checkout-billing,
    .woocommerce-checkout .checkout-shipping,
    .woocommerce-checkout .checkout-order-review {
        padding: 20px;
    }
    
    .woocommerce-account .woocommerce-MyAccount-content {
        padding: 20px;
    }
}

/* ==========================================================================
   主题特定样式集成
   ========================================================================== */

/* 确保与主题颜色方案一致 */
:root {
    --woo-primary-color: #007cba;
    --woo-secondary-color: #005a8b;
    --woo-success-color: #28a745;
    --woo-danger-color: #dc3545;
    --woo-warning-color: #ffc107;
    --woo-info-color: #17a2b8;
    --woo-light-color: #f8f9fa;
    --woo-dark-color: #212529;
    --woo-border-color: #dee2e6;
    --woo-border-radius: 6px;
    --woo-box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    --woo-transition: all 0.3s ease;
}

/* 覆盖WooCommerce默认颜色 */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    background: var(--woo-primary-color) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--woo-border-radius) !important;
    padding: 12px 25px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: var(--woo-transition) !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
    background: var(--woo-secondary-color) !important;
    color: #fff !important;
}

/* 确保表单样式一致 */
.woocommerce .form-row input.input-text,
.woocommerce .form-row textarea,
.woocommerce .form-row select {
    border: 2px solid var(--woo-border-color) !important;
    border-radius: var(--woo-border-radius) !important;
    padding: 12px 15px !important;
    font-size: 14px !important;
    transition: var(--woo-transition) !important;
}

.woocommerce .form-row input.input-text:focus,
.woocommerce .form-row textarea:focus,
.woocommerce .form-row select:focus {
    border-color: var(--woo-primary-color) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
}